package com.awanp3.nimbus.base.dubbo;

import com.awanp3.nimbus.base.api.RemotePlantService;
import com.awanp3.nimbus.base.api.domain.vo.RemotePlantVo;
import com.awanp3.nimbus.base.domain.bo.BasePlantBo;
import com.awanp3.nimbus.base.domain.vo.BasePlantVo;
import com.awanp3.nimbus.base.service.IBasePlantService;
import com.awanp3.nimbus.common.core.utils.MapstructUtils;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 工厂远程服务
 *
 * @author 20014170
 */
@RequiredArgsConstructor
@Service
@DubboService
public class RemotePlantServiceImpl implements RemotePlantService {

    private final IBasePlantService basePlantService;

    /**
     * 查询工厂列表
     *
     * @return 工厂列表
     */
    @Override
    public List<RemotePlantVo> queryList() {
        List<BasePlantVo> list = basePlantService.queryList(new BasePlantBo());
        return MapstructUtils.convert(list, RemotePlantVo.class);
    }
}
